package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.PublicReview;
import com.ruoyi.system.mapper.PublicReviewMapper;
import com.ruoyi.system.service.PublicReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 柳
 * @Date 2021/3/10
 * @Description TODO
 */
@Service
public class PublicReviewServiceImpl implements PublicReviewService {

    @Autowired
    private PublicReviewMapper publicReviewMapper;

    /**
     * 查询是否到达最大投票数
     * @param publicReview
     * @return
     */
    @Override
    public Integer queryMaxVotePublicReview(PublicReview publicReview) {

        return publicReviewMapper.queryMaxVotePublicReview(publicReview);
    }

    /**
     * 查询是否重复投票
     * @param publicReview
     * @return
     */
    @Override
    public Integer queryRepetitionPublicReview(PublicReview publicReview) {
        return publicReviewMapper.queryRepetitionPublicReview(publicReview);
    }

    /**
     * 添加信息
     * @param publicReview
     */
    @Override
    public void savePublicReview(PublicReview publicReview) {
        publicReviewMapper.savePublicReview(publicReview);
    }
}
